import cv2
import numpy as np
def detectAndDescribe(image):
    gray=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
    sift=cv2.SIFT_create()
    kp,des=sift.detectAndCompute(gray,None)
    image=cv2.drawKeypoints(image,kp,image)
    return image,kp,des
    img1=cv2.imread("Resources/left_02.png")
    img2=cv2.imread("Resources/right_02.png")
    imgA=img1.copy()
    imgB=img2.copy()
    #调用函数detectAndDescribe(),检测、计算并绘制特征点
    imgA,kpA,=detectAndDescribe(imgA)
    imgB,kpB,desB=detectAndDescribe(imgB)
    imput=np.hstack((imgA,imgB))
    cv2.imshow('keypoints_Input',input)